package nju.mscs.gui;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;

import nju.mscs.businesslogic.*;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class Cashier extends javax.swing.JFrame {
	private JLabel jLabel1;
	private JLabel jLabel2;
	private JButton jButton2;
	private JComboBox jComboBox1;
	private JButton jButton1;
	/**
	* Auto-generated main method to display this JFrame
	*/
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				Cashier inst = new Cashier();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
			}
		});
	}
	
	public Cashier() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			getContentPane().setLayout(null);
			{
				jLabel1 = new JLabel();
				getContentPane().add(jLabel1);
				jLabel1.setText("\u6b22\u8fce\u4f7f\u7528\u8d85\u5e02\u7ba1\u7406\u7cfb\u7edf");
				jLabel1.setBounds(57, 34, 287, 41);
				jLabel1.setFont(new java.awt.Font("微软雅黑",0,26));
			}
			{
				jLabel2 = new JLabel();
				getContentPane().add(jLabel2);
				jLabel2.setText("\u8bf7\u9009\u62e9\u60a8\u6240\u8981\u8fdb\u884c\u7684\u64cd\u4f5c\uff1a");
				jLabel2.setBounds(28, 115, 206, 15);
				jLabel2.setFont(new java.awt.Font("微软雅黑",0,14));
			}
			{
				jButton1 = new JButton();
				getContentPane().add(jButton1);
				jButton1.setText("\u786e\u5b9a");
				jButton1.setBounds(85, 161, 66, 26);
				jButton1.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent evt) {
						jButton1ActionPerformed(evt);
					}
				});
			}
			{
				jButton2 = new JButton();
				getContentPane().add(jButton2);
				jButton2.setText("\u6ce8\u9500");
				jButton2.setBounds(205, 161, 66, 26);
				jButton2.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent evt) {
						jButton2ActionPerformed(evt);
					}
				});
			}
			{
				ComboBoxModel jComboBox1Model = 
					new DefaultComboBoxModel(
							new String[] { "销售商品", "商品退货","VIP查询" });
				jComboBox1 = new JComboBox();
				getContentPane().add(jComboBox1);
				jComboBox1.setModel(jComboBox1Model);
				jComboBox1.setBounds(201, 111, 124, 22);
			}
			pack();
			this.setSize(392, 254);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}
	
	private void jButton2ActionPerformed(ActionEvent evt) {
		//System.out.println("jButton2.actionPerformed, event="+evt);
		login1.main(null);
		this.dispose(); //注销按钮事件响应
	}
	
	private void jButton1ActionPerformed(ActionEvent evt) {
		//System.out.println("jButton1.actionPerformed, event="+evt);
		String choice = jComboBox1.getSelectedItem().toString();
		
		/*if(choice.equals("销售商品")){			
			cs.main(null);
			cs.jTabbedPane1.
		}
		if(choice.equals("商品退货")){
			Return rt = new Return();
			Return.main(null);
		}
		if(choice.equals("VIP查询")){
			VIP vip = new VIP();
			VIP.main(null);
		}*/
		CashierService.main(null);
		this.dispose();
		//确定按钮事件响应
	}

}
